package day0212;

public class Test1 {
    //第十天早上，还没吃的时候发现只剩1个桃子了，问第一天还没吃之前有多少个桃子。 //吃一半儿后再吃一个

    public static void main(String[] args) {
        int peach=1;
        for (int day = 1; day <=9 ; day++) {
            peach=(peach+1)*2;
        }
        System.out.println(peach);
    }



   /* public synchronized void producer()throws InterruptedException{//设置锁
        synchronized(this) {
            System.out.println("生产");
            Thread.sleep(3000);
        }
    }

    public  void cost()throws InterruptedException{
        synchronized(this) {
            System.out.println("消费");
            Thread.sleep(3000);
        }
    }*/


    /*public static void main(String[] args) {
        day0303_wuKai.Test1 t=new day0303_wuKai.Test1();
        Thread t1=new Thread(){
            public void run() {
                try {
                    t.producer();
                } catch (InterruptedException e) {
                }
            }
        };


        Thread t2=new Thread(){
            public void run() {
                try {
                    t.cost();
                } catch (InterruptedException e) {
                }
            }
        };
        t2.start();
        t1.start();
    }
*/


}
